package chen.web.controller.forum.form;

import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.NotEmpty;

import chen.web.controller.AdminRoleVerify;
import chen.web.controller.UbbParserFactory;
import chen.web.util.ubb.UbbParser;

public class ReplyForm {
	
	@NotEmpty
	@Size(min=3)
	private String content;

	public void setContent(String content) {
		UbbParser parser = AdminRoleVerify.isAdmin() ? UbbParserFactory.standard():
							UbbParserFactory.safe();
		this.content = parser.parse(content).toUbb(true);
	}

	public String getContent() {
		return content;
	}
	
}
